

var scenarioList = [
    {
        id:1,
        title:'公共交通行业',
        summary: ['地铁站','火车站','高铁站','机场','高速服务区'],
        name: 'PUBLIC INDUSTRY',
        cover:'https://bym-website.gz.bcebos.com/assets/production-vending/Product_zdsmj_yycj_001.png'
    },
    {
        id:2,
        title:'零售行业',
        summary: ['商场','商城','超市','步行街','品牌服饰店'],
        name: 'RETAIL INDUSTRY',
        cover:'https://bym-website.gz.bcebos.com/assets/production-vending/Product_zdsmj_yycj_002.png'
    },
    {
        id:3,
        title:'娱乐休闲行业',
        summary: ['影院门口','高端美容美发店','旅游景区','游乐园'],
        name: 'LEISURE INDUSTRY',
        cover:'https://bym-website.gz.bcebos.com/assets/production-vending/Product_zdsmj_yycj_003.png'
    },
    {
        id:4,
        title:'酒店餐饮行业',
        summary: ['酒店大堂','人员密集等候排队饭店'],
        name: 'HOTEL INDUSTRY',
        cover:'https://bym-website.gz.bcebos.com/assets/production-vending/Product_zdsmj_yycj_004.png'
    },
    {
        id:5,
        title:'其他',
        summary: ['写字楼','学校教学楼','……'],
        name: 'OTHER INDUSTRY',
        cover:'https://bym-website.gz.bcebos.com/assets/production-vending/Product_zdsmj_yycj_005.png'
    }
];



new Vue({

    data:{
        isActive: false,
        windowHeight:0
    },
    methods:{
        //设置元素状态
        setActive: function( el, stateName ){

            if( el.getBoundingClientRect().top < this.windowHeight ){
                this[stateName] = true;
            }
            if( el.getBoundingClientRect().bottom < 0 || el.getBoundingClientRect().top > this.windowHeight ){
                this[stateName] = false;
            }
        },
        //设置视窗高度
        setWindowHeight:function(){
            this.windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
        }
    },

    mounted:function(){
        var self = this;
        //初始化视窗高度
        self.setWindowHeight();
        window.onResize = debounce( function(){
            alert("ff");
            self.setWindowHeight();
        } ,200);

        window.onscroll = debounce(function(){
            self.setActive( self.$refs['picture'], "isActive" );
        }, 200);


    }


}).$mount('#configure');

